const router = require('koa-router')()
const goodsSku = require('../api/myGoodsSku')
router.prefix('/goodsSku')
// #region
/**
 * @swagger
 * /goodsSku/modifySku 修改或增加sku大类:
 *   post:
 *     description: 修改或增加sku大类
 *     tags: [商品Sku模块]
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: id
 *         description: 大类id，传了为修改，没有传id为增加
 *         in: formData
 *         required: false
 *         type: number
 *       - name: k
 *         description: sku类名
 *         in: formData
 *         required: true
 *         type: number
 *       - name: largeImageMode
 *         description: 是否展示大图模式（用于前端）
 *         in: formData
 *         required: false
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.post('/modifySku', goodsSku.modifySku)
// #region
/**
 * @swagger
 * /goodsSku/getSkuList 获取商品Sku大类列表:
 *   get:
 *     description: 获取商品Sku大类列表
 *     tags: [商品Sku模块]
 *     parameters:
 *       - name: page
 *         description: 页码
 *         in: formData
 *         required: false
 *         type: number
 *       - name: size
 *         description: 页数
 *         in: formData
 *         required: true
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 */
// #endregion
router.get('/getSkuList', goodsSku.getSkuList)
// #region
/**
 * @swagger
 * /goodsSku/deleteSku 删除sku大类（参数放到请求头query）:
 *   delete:
 *     description: 删除sku大类（参数放到请求头query）
 *     tags: [商品Sku模块]
 *     parameters:
 *       - name: id
 *         description: Sku id
 *         in: formData
 *         required: false
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.delete('/deleteSku', goodsSku.deleteSku)
// #region
/**
 * @swagger
 * /goodsSku/getMyGoodsSku 获取该商品的sku规格（根据商品id查询）:
 *   get:
 *     description: 获取该商品的sku规格（根据商品id查询）
 *     tags: [商品Sku模块]
 *     parameters:
 *       - name: goodsId
 *         description: 传商品id查询单个商品下的列表
 *         in: formData
 *         required: true
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.get('/getMyGoodsSku', goodsSku.getMyGoodsSku)
module.exports = router